package com.fanghuaiming.lcn.account.service.impl;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.fanghuaiming.lcn.account.dao.mapper.AccountMapper;
import com.fanghuaiming.lcn.account.dao.model.Account;
import com.fanghuaiming.lcn.account.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/****
 * @description: 账户服务接口实现类
 * @version:1.0.0
 * @author fanghuaiming
 * @data Created in 2020/11/27 下午1:59
 *
 */
@Service
@Slf4j
public class AccountServiceImpl implements AccountService {

    /**
     * 账户mapper
     */
    @Autowired
    private AccountMapper accountMapper;

    /**
     * @Description: 扣减账户
     *
     * @param:
     * @return:
     * @auther: fanghuaiming
     * @date: 2020/11/27 下午2:09
     * @version:1.0.0
     */
    @SuppressWarnings("all")
    @Transactional
    @LcnTransaction
    @Override
    public void reduceAccount(Account account) {
        log.info("=================开始请求-账户微服务-reduceAccount扣减账户Service=================");
        accountMapper.reduceAccount(account);
        log.info("=================请求-账户微服务-reduceAccount扣减账户Service完成=================");
    }
}
